<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
</head>
<body>
<div id="app"></div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script src="https://cdn.bootcdn.net/ajax/libs/dayjs/1.8.9/dayjs.min.js"></script>

<script>
    const ws =new WebSocket('wss://qq.wyx2013.cn/ws8201/debug');
    let cs=0;
    ws.onmessage=function (e) {
        cs++;
        if(cs>20){
            $('#app').html('');
            cs=0;
        }
        let time=dayjs().format('HH:mm:ss');
        $('#app').append(`<p>${time}:${e.data}</p>`)

    };
    ws.onopen=function () {
        setInterval(()=>{
            ws.send('null')
        },50000)
    }
</script>
</body>
</html>